<template>
  <div>
    <div class="recommend-title">热销推荐</div>
    <ul>
      <router-link
        tag="li"
        class="item border-bottom"
        v-for="item in recommendList"
        :key="item.id"
        to="/detail"
      >
        <img class="item-img" src="@/static/img/123.png" />
        <div class="item-info">
          <p class="item-title">{{ item.title }}</p>
          <p class="item-desc">{{ item.desc }}</p>
          <div class="item-button">查看详情</div>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "HomeRecommend",
  data() {
    return {
      recommendList: [
        {
          id: "0001",
          title: "长隆水上乐园",
          desc: "浪漫长隆，浪漫的水上世界",
        },
        {
          id: "0002",
          title: "长隆水上乐园",
          desc: "浪漫长隆，浪漫的水上世界",
        },
        {
          id: "0003",
          title: "长隆水上乐园",
          desc: "浪漫长隆，浪漫的水上世界",
        },
      ],
    };
  },
};
</script>

<style lang="stylus" scoped>
.recommend-title {
  background: #eee;
  line-height: 1.8rem;
  text-indent: 0.2rem;
  margin-top: 0.2rem;
}

.item {
  overflow: hidden;
  display: flex;
  height: 3.1rem;
}

.item-img {
  width: 2.7rem;
  height: 2.7rem;
  padding: 0.1rem;
}

.item-info {
  flex: 1;
  padding: 0.5rem;
  min-width: 0;
}

.item-title {
  line-height: 0.54rem;
  font-size: 0.5rem;
}

.item-desc {
  line-height: 0.9rem;
  color: #ccc;
}

.item-button {
  line-height: 0.88rem;
  margin-top: 0.16rem;
  background: #ff9300;
  padding: 0 0.2rem;
  border-radius: 0.6rem;
  color: #fff;
  text-align: center;
}
</style>